import { Injectable } from '@angular/core';

@Injectable({
  providedIn: 'root'
})
export class LogService {
  private logger: any;
  constructor() { }
  doLog(level: string, ...args: any[]): void {
    if (this.logger) {
      this.logger.doLog(level, ...args)
    } else {
      console[level](...args);
    }
  }

  debug(...args: any[]): void {
    this.doLog('debug', ...args)
  }

  info(...args: any[]): void {
    this.doLog('info', ...args)
  }

  warn(...args: any[]): void {
    this.doLog('warn', ...args)
  }

  error(...args: any[]): void {
    this.doLog('error', ...args)
  }

  log(...args: any[]): void {
    this.doLog('log', ...args)
  }

}
